package GenericTest;

import java.util.List;
import java.util.ArrayList;

public class GenericMethods {
    public static void main(String[] args) {
        Integer[] arr = new Integer[] { 1, 2, 3, 4, 5 };
        List<Integer> list = Order_G1.copyFromArrayToList(arr);
        System.out.println(list);
    }
}

class Order_G1<T> {
    T title;

    Order_G1(T title) {
        this.title = title;
    }

    T getOrder() {
        return title;
    }

    public static <E> List<E> copyFromArrayToList(E[] arr) {
        ArrayList<E> list = new ArrayList<>();
        for (E e : arr) {
            list.add(e);
        }
        return list;
    }
}
